<?php
/*
 * This file is part of Compost.
 *
 * Compost is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Compost is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Compost.  If not, see <http://www.gnu.org/licenses/>.
 */

header("HTTP/1.1 404 Not Found"); ?>
<?php $pagename = $heading; $description = $message; $tab = ''; ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title><?php echo strip_tags($pagename); ?><?php echo (isset($pagenameTag))? ' - ' .$pagenameTag : '';?> [compost]</title>
	<link rel="stylesheet" type="text/css" href="/style/style.css" media="screen" />
	<link rel="stylesheet" type="text/css" href="/style/print.css" media="print" />
	<link rel="stylesheet" type="text/css" href="/script/jquery.rating.css"/>
	<link rel="stylesheet" type="text/css" href="/script/css/colorpicker.css" />
	<link rel="stylesheet" type="text/css" href="/style/custom-theme/jquery-ui-1.7.2.custom.css" />
	<link rel="shortcut icon" href="http://preview.rtraction.com/favicon.ico" />
	<!--[if lte IE 7]>
		<link rel="stylesheet" type="text/css" href="/style/ie7.css" media="screen" />
	<![endif]-->
	<script type="text/javascript">
		var ie=0;	
	</script>
	<!--[if IE]><script type="text/javascript">
		var ie=1;
	</script><![endif]-->
	
	<script src="/script/jquery-1.3.2.min.js" type="text/javascript"></script>
	<script src="/script/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
	<script src="/script/jquery.rating.pack.js" type="text/javascript"></script>
	<script src="/script/jquery.scrollTo-min.js" type="text/javascript"></script>
	<script src="/script/js/colorpicker.js" type="text/javascript"></script>
	<script src="/script/ajaxupload.3.2.js" type="text/javascript"></script>
	<script src="/script/interface.php" type="text/javascript"></script>
	<script type="text/javascript" src="/script/jquery.qtip-1.0.0-rc3.min.js"></script>
	
</head>
<body>
	<div id="header">
		<h1>
			rtraction design previews
		</h1>
		<ul id="menu">
			<?php if (isset($_SESSION["userrole"])) { ?>
				<li class='<?php echo $tab == "dashboard" ? "current" : ''; ?> <?php echo $_SESSION['userrole'] != "-1" ? 'noborder' : ''; ?>'>
					<a href="/admin">
						Dashboard
					</a>
				</li>
			<?php } ?>
			<?php if (isset($_SESSION["userrole"]) && $_SESSION["userrole"] == "-1") { ?>
				<li <?php echo $tab == "clients" ? "class='current'" : ''; ?>>
					<a href="/client/listing">
						Clients
					</a>
				</li>
			<?php } ?>
			<?php if (isset($_SESSION["userrole"]) && $_SESSION["userrole"] == "-1") { ?>
				<li <?php echo $tab == "users" ? "class='current'" : ''; ?>>
					<a href="/users/listing">
						Users
					</a>
				</li>
			<?php } ?>
			<?php if (isset($_SESSION["userrole"]) && $_SESSION['userrole'] == "-1") { ?>
				<li class="<?php echo $tab == "projects" ? " current " : ''; echo $_SESSION["userrole"] != -1 ? " noborder " : ""; ?>">
					<a href="<?php echo $_SESSION["userrole"] == -1 ? "/project/listing" : "/client/open/".$_SESSION['userrole']; ?>">
						Projects
					</a>
				</li>
			<?php } ?>
			<?php if (isset($_SESSION["userrole"]) && $_SESSION["userrole"] == "-1") { ?>
				<li class="noborder<?php echo $tab == "archive" ? " current" : ''; ?>">
					<a href="/client/open/-1">
						Archive
					</a>
				</li>
			<?php } ?>
			
		</ul>
	</div>
	<div id="wrap">
		<div id="page">
			<?php if(isset($menu) && is_array($menu)) { ?>
				<ul id="rightlink"> 
					<?php echo isset($premenu) ? "<li>".$premenu."</li>" : ''; ?>				
					<?php foreach ($menu as $item) { ?>
						<li> 
							<a href="<?php echo $item['link']; ?>"><?php echo $item['name']; ?></a> 
							<?php echo isset($item['help']) ? '<a target="_blank" href="/help#'.$item['help'].'" title="Huh?">(?)</a>' : ''; ?>
						</li>
					<?php } ?>
				</ul> 
			<?php } ?>
			<div id="content">
				<h2><?php echo $pagename; ?></h2>
				<br style="clear: both;" />
				<?php if (isset($description) && strlen($description) > 0) {?>
					<p id="description"><?php echo $description; ?>
					<a href="/">Click here to start over.</a>
					</p>
				<?php } ?>
				<?php echo isset($error) ? "<p class='red'>".$error."</p>" : ''; ?>
				</div>
	<br style="clear: both;" />
		</div>
		<div id="footer">
      <br style="clear: both;" />
		</div>
	</div>
</body>
</html>